﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DungeonDelver.Common
{
    public class RandomNumberGenerator<T>: IRandomNumberGenerator<T>
    {
        private Random theSource = null;
        public Random Source
        {
            get
            {
                return theSource;
            }
            set
            {
                theSource = value;
            }
        }

        private Func<IRandomNumberGenerator<T>, T, T, T> theLambda = null;
        public Func<IRandomNumberGenerator<T>, T, T, T> Lambda
        {
            get
            {
                return theLambda;
            }
            set
            {
                theLambda = value;
            }
        }

        public T Next(T minimum, T maximum)
        {
            return Lambda(this, minimum, maximum);
        }
    }
}
